package com.spider.silence.job;

import com.spider.silence.downloader.AiKaForumDownLoader;
import com.spider.silence.pool.AiKaDownLoaderPool;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.StatefulJob;

/**
 * @author 夏茂轩
 * @package com.spider.silence.job
 * @Date 2017/3/8 20:39
 */
public class AiKaJob implements StatefulJob {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        AiKaForumDownLoader downLoader =null;
        try {
            downLoader = AiKaDownLoaderPool.getInstance().fetchDownLoader(1000);
            downLoader.generateTask();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }finally {
            AiKaDownLoaderPool.getInstance().releaseDownLoader(downLoader);
        }
    }
}
